//
//  CFMacro.h
//  CoolFM
//
//  Created by 曹曹 on 16/8/27.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#ifndef CFMacro_h
#define CFMacro_h

// 调试打印,系统生成的全局宏,debug模式下打印调试信息,release模式下不会打印
#ifdef DEBUG
#define NSLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define NSLog(...)
#endif
// 判断设备
#define IS_IPHONE           (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define IS_IPHONE_4         (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 480.0f)
#define IS_IPHONE_5         (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f)
#define IS_IPHONE_5         (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f)
#define IS_IPHONE_5_OR_HIGHER         (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height >= 568.0f)
#define IS_IPHONE_6         (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0f)
#define IS_IPHONE_6_PLUS         (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0f)
// 屏幕尺寸
#define SCREEN_RECT         [UIScreen mainScreen].bounds
#define SCREEN_SIZE         [UIScreen mainScreen].bounds.size
#define SCREEN_WIDTH        SCREEN_SIZE.width
#define SCREEN_HEIGHT       SCREEN_SIZE.height
// 随机颜色
#define kArc4RandomColor [UIColor colorWithRed:arc4random() % 256 / 255.0f green:arc4random() % 256 / 255.0f blue:arc4random() % 256 / 255.0f alpha:0.6];
// 默认的深绿色
#define kDefaultColor [UIColor colorWithRed:0.11 green:0.69 blue:0.56 alpha:1.00]
// 主播页接口
#define kDJURL(location,order,page_index) [NSString stringWithFormat:@"http://api.kufm.cn/v3/get_dj/location/%d/order/%d/page_info?bar_height=81&page_index=%d&page_size=20&total_height=627", location, order, page_index]
// 主播页地区接口
#define kDJLocationURL @"http://api.kufm.cn/v3/playback/dj_tag/location/list_info"
// 电台页接口
#define kRadioURL(location,category,page_index) [NSString stringWithFormat:@"http://api.kufm.cn/program_list/location/%d/category/%d?bar_height=81&page_index=%d&page_size=20&total_height=627", location, category, page_index]
// 节目页接口
#define kProgramURL(location,category,order,page_index) [NSString stringWithFormat:@"http://api.kufm.cn/v3/playback/all_record_play/location/%d/category/%d/order/%d/page_info_v4?page_size=10&page_index=%d&total_height=627.000000&bar_height=81.000000", location, category, order, page_index]
// 注册 tableView cell xib 文件
#define kTalbleViewRegisterNib(name,identifier) [_tableView registerNib:[UINib nibWithNibName:name bundle:nil] forCellReuseIdentifier:identifier]
// 注册 collectionView cell xib 文件
#define kCollectionViewRegisterNib(name,identifier) [_collectionView registerNib:[UINib nibWithNibName:name bundle:nil] forCellWithReuseIdentifier:identifier]
// 评论字体大小
#define kFont11 [UIFont systemFontOfSize:12]
// 占位图
#define kPlacoHolderImage @"img_dj_head"
// app-ID
#define kAppID @"d0ce47483e6728610311619cca3fb195"
//
#define kCachesDirectory [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject]
//
#define kUser @"user"
#define kContact @"contact"
#define kPassword @"password"
#define kcreated_at @"create_at"

#endif /* CFMacro_h */
